package com.diy.sigmund.diycommon.test.controller.other;

import com.diy.sigmund.diycommon.entity.ResultMsg;
import com.diy.sigmund.diycommon.spring.CustomApplicationContext;
import com.diy.sigmund.diycommon.spring.extensionpoint.event.EmailEvent;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ylm-sigmund
 * @since 2022/9/21 10:45
 */
@RestController
public class ApplicationEventTestController {

    @PostMapping("/ApplicationEventTestController")
    public ResultMsg test1() {
        CustomApplicationContext.getApplicationContext()
                .publishEvent(
                        new EmailEvent("hello", "12345@qq.com", "this is a test"));
        return ResultMsg.success();
    }

}
